<template>
    <!-- 主体可变化内容 -->
    <div class="main-content">
        <div class="zhiTiSheng-show">
            <div class="title">智提升</div>
            <div class="right-content">
                <div
                    class="item"
                    v-for="(item, index) in zhiTiShengList"
                    @click="goUrl(item.url)"
                    :key="index"
                >
                    <div class="right-content-item-zts">
                        <div class="item-zhiTiSheng">
                            <img :src="item.img" />
                            {{ item.title }}
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
export default {
    data() {
        return {
            zhiTiShengList: [
                {
                    title: "作业",
                    img: require("@/assets/images/icon/tongbu.png"),
                    url: "/work/selectClass/index"
                },
                {
                    title: "测验",
                    img: require("@/assets/images/icon/画板 1 副本 9@2x(1).png"),
                    url: "/test/selectClass/index"
                },
                {
                    title: "名课",
                    img: require("@/assets/images/icon/2.png"),
                    url: ""
                },
                {
                    title: "同步",
                    img: require("@/assets/images/icon/画板 1 副本 9@2x(2).png"),
                    url: "/synchronization/practice/index"
                },
                {
                    title: "趣练",
                    img: require("@/assets/images/icon/qulian.png"),
                    url: "/InterestingPractice/practice/index"
                },
                {
                    title: "自评",
                    img: require("@/assets/images/icon/ziping.png"),
                    url: "/selfEvaluation/practice/index"
                },
                {
                    title: "笔记",
                    img: require("@/assets/images/icon/ziping.png"),
                    url: ""
                }
            ]
        };
    },
    computed: {},
    watch: {},
    beforeCreate() {
        // 生命周期钩子：组件实例刚被创建，组件属性计算之前，如 data 属性等
    },
    created() {
        // 生命周期钩子：组件实例创建完成，属性已绑定，但 DOM 还未生成，el 属性还不存在
        // 初始化渲染页面
    },
    beforeMount() {
        // 生命周期钩子：模板编译/挂载之前
    },
    mounted() {
        // 生命周期钩子：模板编译、挂载之后（此时不保证已在 document 中）
    },
    methods: {
        goUrl(url) {
            if (url == "") {
                this.$message({
                    message: "暂无开启",
                    type: "warning"
                });
            } else {
                this.$router.push({
                    path: url
                });
            }
        }
    }
};
</script>

<style lang="scss" scoped>
.main-content {
    .right-content {
        display: flex;
        flex-wrap: wrap;
        padding: 24px 0px;
    }
    .title {
        font-size: 20px;
        margin-left: 13px;
    }
}
.zhiTiSheng-show {
    padding: 24px;
    box-sizing: border-box;
    margin: 0 auto;
}
.right-content {
    .item {
        height: 200px;
        width: 270px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}
.right-content-item-zts {
    width: 245px;
    height: 172px;
    background: #ffffff;
    border: 1px solid #dadfe6;
    opacity: 1;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}
.item-zhiTiSheng {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #2d3440;
    img {
        height: 80px;
        width: 80px;
    }
}
.layui-tab {
    margin: 0px;
}
</style>
